//
// Created by hsj on 2022/2/23.
//

#include "student.h"

namespace t_student_with_has_a{
    //c++里面标准写法
    //但是更喜欢java风格，直接全部写在class里面
    double Student::Average()const{
        if (scores.size() <= 0){return 0;}
        return scores.sum()/scores.size();
    }

    void set(Student &stu,int n){
        cout<<"Please enter the student`s name:";
        getline(cin,stu);
        cout<<"Please enter "<<n<<"quiz score:"<<endl;
        for (int i = 0; i < n; ++i) {
            cin>>stu[i];
        }
        while (cin.get() != '\n'){
            continue;
        }
    }
}
